//
//  SubmitViewCell.m
//  ForestPack
//
//  Created by 骆锴 on 2018/7/23.
//  Copyright © 2018年 郑洲. All rights reserved.
//

#import "SubmitViewCell.h"
@interface SubmitViewCell ()

@property (nonatomic, strong) UIButton *submit;

@end

@implementation SubmitViewCell

+ (SubmitViewCell *)cellWithTableView:(UITableView *)tableView andIndexPath:(NSIndexPath *)indexPath{
    static NSString *cellID = @"SubmitCell";
    SubmitViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[SubmitViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
        cell.backgroundColor = [UIColor whiteColor];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        [cell createSubView];
    }
    
    return cell;
}

-(void)createSubView{
    _submit = [[UIButton alloc] initWithFrame:CGRectMake(ScreenX375(13), ScreenX375(55), ScreenX375(349), ScreenX375(44))];
    _submit.backgroundColor = ThemeColor;
    _submit.layer.cornerRadius = 22.0;
    _submit.tag = 100;
    [_submit setTitle:@"提需求" forState:UIControlStateNormal];
    [self addSubview:_submit];
}

- (void)classClick:(UIButton *)btn{
    if (_indexClick) {
        _indexClick(btn.tag - 100);
    }
}

@end
